namespace Shumei.EFCore.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class add_CourseVideo : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.CourseVideos",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        DesName = c.String(nullable: false, maxLength: 50, storeType: "nvarchar"),
                        No = c.Int(nullable: false),
                        VideoUrl = c.String(nullable: false, unicode: false),
                        VideoLen = c.Int(nullable: false),
                        Course_Id = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Courses", t => t.Course_Id, cascadeDelete: true)
                .Index(t => t.Course_Id);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.CourseVideos", "Course_Id", "dbo.Courses");
            DropIndex("dbo.CourseVideos", new[] { "Course_Id" });
            DropTable("dbo.CourseVideos");
        }
    }
}
